﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace ESOL.Common
{
    public class Encryption
    {
        public static string Encrypt(string data)
        {
            try
            {
                MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
                string md5Hash = Convert.ToBase64String(md5.ComputeHash(UTF8Encoding.Default.GetBytes(data)));
                return md5Hash;
            }
            catch
            {
                return "";
            }

        }
    }
}
